package guet.dream.common.freemarker;


import java.util.*;

/**
 * 
 * @author banxi1988
 *
 */
public class Page {
	private String template;//freemarker 模板方式：模板最后可能存在数据库中以解决分布式问题
    private String forward;//用于内部forward如 forward到error页面
    private String redirect;//用于直接跳转
    private Map root = new HashMap();

    public String getTemplate() {
        return template;
    }
    
    public void setTemplate(String template) {
        forward = null;
        this.template = template;
    }

    public void put(String name, Object value) {
        root.put(name, value);
    }
    
    public void put(String name, int value) {
        root.put(name, new Integer(value));
    }
    
    public void put(String name, double value) {
        root.put(name, new Double(value));
    }

    public void put(String name, boolean value) {
        root.put(name, new Boolean(value));
    }
    
    public Map getRoot() {
        return root;
    }
    
    public String getForward() {
        return forward;
    }

    public void setForward(String forward) {
        template = null;
        this.forward = forward;
    }
	public String getRedirect() {
		return redirect;
	}
	public void setRedirect(String redirect) {
		this.redirect = redirect;
	}

}
